import request from '@/utils/axios';

const endpoint = 'https://api.chatgpt.com';

export const getChatGPT = async (message) => {
  try {
    const response = await request.post(`${endpoint}/gpt`, {
      message: message,
    });
    return response.data.response;
  } catch (error) {
    console.error(error);
    return '无法连接到ChatGPT API';
  }
};
